<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
</head>
<body>
<div th:fragment="pagination">

    <div class="pagination" th:with="baseUrl=${URLparameter}">
<!--        <span th:if="${pager.indexOutOfBounds()}">-->
<!--            返回<a class="pageLink" th:href="@{${baseUrl}(page=1)}">主页</a>.-->
<!--        </span>-->

        <span th:unless="${pager.indexOutOfBounds()}">

            <span th:if="${pager.hasPrevious()}">
                <a class="pageLink"
                   th:href="@{${baseUrl}(page=1)}">&laquo; 第一页</a>
                <a class="pageLink"
                   th:href="@{${baseUrl}(page=${pager.getPageIndex() - 1})}"> 上一页</a>
            </span>

            <span th:if="${pager.getTotalPages() != 1}"
                  th:text="'第' + ${pager.getPageIndex()} + '页，共' + ${pager.getTotalPages()} + '页'">
            </span>

            <span th:if="${pager.hasNext()}">
                <a class="pageLink"
                   th:href="@{${baseUrl}(page=${pager.getPageIndex() + 1})}">下一页</a>
                <a class="pageLink"
                   th:href="@{${baseUrl}(page=${pager.getTotalPages()})}">最后 &raquo;</a>
            </span>
        </span>
    </div>

</div>
</body>
</html>